package com.my12306.user.model.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.my12306.user.config.JsonLongSerializer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Objects;

/**
 * @Author:苏牧夕
 * @Date:2020-05-15 17:36:13
 * @Version 1.0
 */
@ApiModel(description = "权限实体")
@Api("权限实体")
public class PermissionVo implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 权限ID
     */
    @ApiModelProperty(value = "权限id", name = "menuId", dataType = "Long")
    @JsonSerialize(using = JsonLongSerializer.class)
    private Long menuId;
    /**
     * 父id
     */
    @ApiModelProperty(value = "父权限id", name = "parentId", dataType = "Long")
    private Long parentId;
    /**
     * 父菜单名字
     */
    @ApiModelProperty(value = "父菜单名字", name = "parentName", dataType = "String")
    private String parentName;
    /**
     * 权限名称
     */
    @ApiModelProperty(value = "权限名称", name = "perms", dataType = "String")
    private String perms;
    /**
     * 菜单名
     */
    @ApiModelProperty(value = "菜单名", name = "name", dataType = "String")
    private String name;
    /**
     * 资源URL
     */
    @ApiModelProperty(value = "资源URL", name = "url", dataType = "String")
    private String url;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", name = "createDate", dataType = "Date")
    private Date createDate;
    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间", name = "updateDate", dataType = "Date")
    private Date updateDate;
    /**
     * 显示状态 0-表示禁用 1-表示正常
     */
    private Integer showStatus;
    /**
     * 类型   0：目录   1：菜单   2：按钮
     */
    @ApiModelProperty(value = "类型   0：目录   1：菜单   2：按钮", name = "type", dataType = "Integer")
    private Integer type;
    /**
     * 菜单图标
     */
    @ApiModelProperty(value = "菜单图标", name = "icon", dataType = "String")
    private String icon;
    /**
     * 排序
     */
    @ApiModelProperty(value = "排序", name = "orderNum", dataType = "Integer")
    private Integer orderNum;

    private Boolean open;
    /**
     * 逻辑删除 0-表示删除，1-表示正常
     */
    private Integer logicDelete;
    /**
     * 子菜单
     */
    @ApiModelProperty(value = "子菜单", name = "list", dataType = "List")
    private List<?> list;
    /**
     * 版本号
     */
    private Integer version;

    public PermissionVo() {
    }

    public PermissionVo(Long menuId, Long parentId, String parentName, String perms, String name, String url, Date createDate, Date updateDate, Integer showStatus, Integer type, String icon, Integer orderNum, Boolean open, Integer logicDelete, List<?> list, Integer version) {
        this.menuId = menuId;
        this.parentId = parentId;
        this.parentName = parentName;
        this.perms = perms;
        this.name = name;
        this.url = url;
        this.createDate = createDate;
        this.updateDate = updateDate;
        this.showStatus = showStatus;
        this.type = type;
        this.icon = icon;
        this.orderNum = orderNum;
        this.open = open;
        this.logicDelete = logicDelete;
        this.list = list;
        this.version = version;
    }

    @Override
    public String toString() {
        return "PermissionVo{" +
                "menuId=" + menuId +
                ", parentId=" + parentId +
                ", parentName='" + parentName + '\'' +
                ", perms='" + perms + '\'' +
                ", name='" + name + '\'' +
                ", url='" + url + '\'' +
                ", createDate=" + createDate +
                ", updateDate=" + updateDate +
                ", showStatus=" + showStatus +
                ", type=" + type +
                ", icon='" + icon + '\'' +
                ", orderNum=" + orderNum +
                ", open=" + open +
                ", logicDelete=" + logicDelete +
                ", list=" + list +
                ", version=" + version +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof PermissionVo)) return false;
        PermissionVo that = (PermissionVo) o;
        return Objects.equals(getMenuId(), that.getMenuId()) &&
                Objects.equals(getParentId(), that.getParentId()) &&
                Objects.equals(getParentName(), that.getParentName()) &&
                Objects.equals(getPerms(), that.getPerms()) &&
                Objects.equals(getName(), that.getName()) &&
                Objects.equals(getUrl(), that.getUrl()) &&
                Objects.equals(getCreateDate(), that.getCreateDate()) &&
                Objects.equals(getUpdateDate(), that.getUpdateDate()) &&
                Objects.equals(getShowStatus(), that.getShowStatus()) &&
                Objects.equals(getType(), that.getType()) &&
                Objects.equals(getIcon(), that.getIcon()) &&
                Objects.equals(getOrderNum(), that.getOrderNum()) &&
                Objects.equals(getOpen(), that.getOpen()) &&
                Objects.equals(getLogicDelete(), that.getLogicDelete()) &&
                Objects.equals(getList(), that.getList()) &&
                Objects.equals(getVersion(), that.getVersion());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getMenuId(), getParentId(), getParentName(), getPerms(), getName(), getUrl(), getCreateDate(), getUpdateDate(), getShowStatus(), getType(), getIcon(), getOrderNum(), getOpen(), getLogicDelete(), getList(), getVersion());
    }

    public Long getMenuId() {
        return menuId;
    }

    public void setMenuId(Long menuId) {
        this.menuId = menuId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public String getPerms() {
        return perms;
    }

    public void setPerms(String perms) {
        this.perms = perms;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Integer getShowStatus() {
        return showStatus;
    }

    public void setShowStatus(Integer showStatus) {
        this.showStatus = showStatus;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public Boolean getOpen() {
        return open;
    }

    public void setOpen(Boolean open) {
        this.open = open;
    }

    public Integer getLogicDelete() {
        return logicDelete;
    }

    public void setLogicDelete(Integer logicDelete) {
        this.logicDelete = logicDelete;
    }

    public List<?> getList() {
        return list;
    }

    public void setList(List<?> list) {
        this.list = list;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }
}
